package com.fxd.crm.web.controller.studentCourse;

import com.fxd.crm.model.course;
import com.fxd.crm.service.ICourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @auther fuxudong
 * @date 2021/4/5 - 13:01
 */
@Controller
@RequestMapping("/studentCourse")
public class studentCourseController {
    @Autowired
    ICourseService courseService;

    @RequestMapping("list")
    public String list() {
        return "studentCourse/list";
    }


    @RequestMapping("add")
    public String add() {
        return "studentCourse/add";
    }

    @RequestMapping("edit")
    public String edit(Model model , Integer course_id) {
        course course = courseService.findByOrderId(course_id);
        model.addAttribute("course", course);
        return "studentCourse/edit";
    }

    @RequestMapping("detail")
    public String detail(Model model, Integer course_id) {
        course course = courseService.findByOrderId(course_id);
        model.addAttribute("course", course);
        return "studentCourse/detail";
    }
}
